/**
 * desc: 内部管理相关接口
 */

import request from '../../utils/request'

// 提交记录
const getRecordList = (data) => {
  return request({
    url: '/api/record/user',
    method: 'GET',
    data
  })
}
//审批员
const getVacationUser = (data) => {
  return request({
    url: '/api/vacation/user',
    method: 'GET',
    data
  })
}

//提交发票
const submitInvoice = (data) => {
  return request({
    url: '/api/invoice',
    method: 'POST',
    data
  })
}

//提交报销
const submitExpense = (data) => {
  return request({
    url: '/api/expense',
    method: 'POST',
    data
  })
}
//审批列表
const getExamineList = (data) => {
  return request({
    url: '/api/record/examine-user',
    method: 'GET',
    data
  })
}


//抄送我的
const getCarbonCopy = (data) => {
  return request({
    url: '/api/record/root-user',
    method: 'GET',
    data
  })
}

//记录详情
const getrecordDetail = (id) => {
  return request({
    url: '/api/record/'+id,
    method: 'GET'
  })
}

//记录撤回、拒绝、同意
const updaterecord = (id,data) => {
  return request({
    url: '/api/record/'+id,
    method: 'PUT',
    data
  })
}

module.exports = {
  getRecordList,
  getVacationUser,
  submitInvoice,
  submitExpense,
  getExamineList,
  getCarbonCopy,
  getrecordDetail,
  updaterecord
}